﻿@using Sharp.Platform.Configuration
@using Sharp.Platform.Mvc.Bootstrap
@model LoginViewModel
@{
    ViewBag.Title = "登录";
    var systemInfo = SystemConfigManage.Read<PlatformInfo>();
}
<!DOCTYPE html>
<html lang="zh-cn" class="app">
<head>
    <meta charset="utf-8" />
    <title>@systemInfo.SysName</title>
    <meta http-equiv="Pragma" content="no-cache">
    <meta http-equiv="Cache-Control" content="no-cache">
    <meta http-equiv="Expires" content="0">
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <link href="~/Content/bootstrap.min.css" rel="stylesheet" />
    <link href="~/Content/AdminLTE.min.css" rel="stylesheet" />
    <link href="~/Content/font-awesome.min.css" rel="stylesheet" />
    <style>
        #Name {
            ime-mode: inactive;
        }

        #divValidateCode {
            margin-bottom: 15px;
        }

            #divValidateCode .col-xs-4 img {
                height: 34px;
            }

        #imgValidateCode {
            cursor: pointer;
        }

        input[type="number"] {
            -moz-appearance: textfield;
        }

        .loginui-box {
            position: absolute;
            top: 50%;
            left: 0;
            margin-top: -200px;
            /*设置负值，为要定位子盒子的一半高度*/
        }
        .baiduicon {
            text-align: center;
            vertical-align: middle;
            line-height:34px;
        }
    </style>

</head>
<body>
    <div class="container-fluid">
        <div class="row">
           
                <div class="well col-lg-4 col-lg-offset-4 col-md-6 col-md-offset-2 col-xs-12 loginui-box">
                    <fieldset>
                        <legend>@systemInfo.SysName</legend>
                    </fieldset>

                    <div>
                        @using (Html.Bootstrap().BeginForm(c => c.AddClass("m-t")))
                    {
                            @Html.AntiForgeryToken()
                            @Html.ValidationSummary(false)
                            <div class="form-group has-feedback">
                                <span class="glyphicon glyphicon-user form-control-feedback"></span>@Html.Bootstrap().TextBoxFor(m => m.Name)

                            </div>
                            <div class="form-group has-feedback">
                                <span class="glyphicon glyphicon-lock form-control-feedback"></span>@Html.Bootstrap().PasswordFor(m => m.Password)

                            </div>
                            <div class="row" id="divValidateCode">
                                <div class="col-xs-8">
                                    @Html.Bootstrap().TextBoxFor(m => m.ValidateCode).AddClass("pull-left").Type().Number()
                                </div>
                                <div class="col-xs-4">
                                    <img id="imgValidateCode" src="@Url.Action("GetValidateCode")" class="pull-right img-responsive" alt="验证码" title="看不清楚，点击刷新。">
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-xs-7  col-xs-offset-1">
                                    <div class="checkbox icheck">
                                        <label class="checkbox-inline ">
                                            <input type="checkbox" id="RememberMe" name="RememberMe" value="false"><i></i> 记住登录
                                        </label>
                                    </div>
                                </div>
                                <div class="col-xs-4 text-right checkbox">
                                    <a href="@Url.Action("ForgotPassword", "Account")">忘记密码？</a>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-xs-12">
                                    @Html.Bootstrap().Button("登录", "btnLogin").Type(ButtonType.Submit).Style(BootstrapStyle.Primary | BootstrapStyle.Block | BootstrapStyle.Flat)
                                </div>
                            </div>
                        <div class="row">
                            <hr title="快捷登录" />
                            <div class="col-xs-12 text-center">
                                <a class="btn btn-social-icon btn-github"><i class="fa fa-github"></i></a>
                                <a class="btn btn-social-icon btn-primary"><i class="fa fa-qq"></i></a>
                                <a class="btn btn-social-icon btn-success"><i class="fa fa-wechat"></i></a>
                                <a class="btn btn-social-icon btn-danger"><i class="fa fa-weibo"></i></a>
                                <a class="btn btn-social-icon btn-primary baiduicon">百度</a>
                            </div>
                        </div>
                    }


                    </div>
                </div>
           
        </div>
    </div>

    @Scripts.Render("~/bundles/Platform/lib")
    @Scripts.Render("~/bundles/Platform/app")
    @if (ViewData.ModelState[""] != null && ViewData.ModelState[""].Errors.Count > 0)
    {
        <script>
            $("#ValidateCode").button("reset")
        </script>
    }
    <script>
        $(function () {
            $('input').iCheck({
                checkboxClass: 'icheckbox_square-blue',
                radioClass: 'iradio_square-blue',
                increaseArea: '20%' // optional
            });
            $("#imgValidateCode").click(function () {
                this.src = this.src + "/?" + Math.random();
            });
            $("#RememberMe").change(function () {
                $("#RememberMe").val($("#RememberMe").val());
            });
        });
    </script>

</body>
</html>